<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
session.setAttribute("yes", "no");
String from=request.getParameter("from");
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>登录 - 同学录 </title>
    
	<meta name="title" content="登录 - 同学录" >
	<meta name="description" content="毕业后，又有多少人与同学断了联系" >
	<meta name="keywords" content="留言" >
    <meta http-equiv="Cache-Control" content="no-cache,no-transform,no-siteapp" />
	<meta http-equiv="Pragma" content="no-cache" />	<meta http-equiv="Expires" content="0" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

	<link href="images/t1-1.png" type="image/x-icon" rel="shortcut icon">

	
	<script src="js/alert.js" type="text/javascript"></script>
	
	<link rel="stylesheet" type="text/css" href="css/footer.css" >
	<link href="css/picpas.css" rel="stylesheet">
	<link href="css/all.css" rel="stylesheet" />
	
  </head>
  
  
<body id="tuchong-com" class="default-p has-subnav" width="100%" style="position:relative;">
<style>
	body{
		background:url(images/login_back.jpg) top left;
		background-size:100% 110%;
		overflow:hidden;
	}
</style>
<div>
	<%@ include file="header.jsp" %>
</div>

<style>
.dialog h2{
text-indent: 1em;
background:#2b9617;
margin: 0;

height: 35px;
padding-top: 9px;
color: #FFF;
font-size: 16px;
font-weight: bold;
}


.dialog-body {
background-color: #FFF;
padding: 20px 8px;
position: relative;
overflow: hidden;
}
.form-group {
margin-left: -7px;
margin-right: -7px;
}

</style>

<script type="text/javascript">

		function checkusername(){
			name = document.getElementById("loginname").value;
			var flag1 = 0;
			var flag2 = 0;
			var preg = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/
			if(preg.test(name)){ 
				flag1 = 1;
			}
		    if(/^(13[0-9]|14[0-9]|15[0-9]|18[0-9])\d{8}$/i.test(mobile_number)){
		        flag2 = 1;
	        } 
			if(flag1 == 1|| flag2 == 1){
			    return true;
			} else {
			    sAlert("邮箱或手机号格式错误");
			    return false;
			}
		}
</script>

<%
	String cookieName =  "" ;    //  在cookie中保存的用户名 
	//  获取cookie中名为"name"的值
	Cookie cookie[]=request.getCookies();
	if(cookie!=null){
		for(int i=0;i<cookie.length;i++){
			Cookie c = cookie[i];
			if(c.getName().equals("name")){
				cookieName = c.getValue(); 
			}
		}
	} 
 
 %>




	<div class="container container-default" style="margin-left:200px; margin-top:0px;">
	<main role="main" class="col-main">
	<section class="with-bg">
	<h1 class="card-header-larger">登录</h1>
	<form class="form-horizontal" action="login.do" method="post" >
		<div class="login-message">
		    <input type="hidden" name="from" id="from" value="<% out.print(from); %>">
		</div>
		<div class="form-group" style="padding-top:10px">
			<label class="col-xs-2 control-label" for="loginEmail">账号</label>
			<div class="col-xs-6">
				<input type="text" class="form-control" id="loginname" name="loginname"  value="<%out.print(cookieName); %>" id="loginname" size="20" required placeholder="请输入手机/邮箱"/>
			</div>
		</div>

		<div class="form-group">
			<label class="col-xs-2 control-label" for="loginpwd">密码</label>
			<div class="col-xs-6">
				<input type="password" class="form-control" name="loginpwd" id="loginpwd" size="20" required />
			</div>
		</div>
		<div class="form-group form-captcha"></div>
		<div class="form-group">
			<div class="col-xs-offset-2 col-xs-4">	
				<div class="checkbox"><input type="checkbox" name="remember" id="remember" checked="checked" />&nbsp;记住用户名</div>
			</div>
		</div>
		<div class="form-group" style="padding-bottom: 15px;">

		    <div class="col-xs-offset-2 col-xs-10" style="padding-top:0px">
				<button class="btn btn-primary" type="submit"  onClick="checkusername()" >登录</button>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				&nbsp;&nbsp;&nbsp;
				<a onclick="alert('开发中。。。')">忘记密码？</a>
			</div>
		</div>

	</form>
	</section>
</main>

<script type="text/javascript">
	function sb(){
		window.location.href="signup.jsp";
	}
</script>

<aside id="side" class="col-side">
	<section class="widget" style="padding:12px;">
		<button class="btn btn-primary" type="button"  style="margin: 0;width: 100%;" onClick="sb()">我还没有注册,马上去注册</button>
	</section>	
	
	<section class="widget">
		<h3 class="card-header">注册后你将可以</h3>
		<ul> 
			<li class="inner">记录“我们”之间的点滴</li>
            <li class="inner">回忆“我们”的故事</li>
            <li class="inner">寻找“他/她”</li>
            <li class="inner">…………</li>
            <li class="inner">还有更多精彩等你来！！！</li>
		</ul>
	</section>
</aside>
	</div>

	<script type="text/javascript">
    //<!--
$('#loginEmail').focus()    //-->
</script>
<script type="text/javascript">
    //<!--
(function(){
    var FeatureLoader = document.createElement('script'); FeatureLoader.type = 'text/javascript'; FeatureLoader.async = true; FeatureLoader.src = 'http://static.connect.renren.com/js/v1.0/FeatureLoader.jsp';
    document.getElementsByTagName('head')[0].appendChild(FeatureLoader);
})();    //-->
</script>	


<script>
    navInit();
    $('.dropdown-toggle').dropdown();
        editableInit();

$(document).ready(function() {
    if ( visitor.id > 0 ){
    	refreshNotifications();
		//setInterval(refreshNotifications, 60000);
	    bindNotifyBarEvents();
    }
     
    if (window.WebSocket && visitor.id > 0) {
		var wsntf = new WSNotification('wss://ws.tuchong.com:3001', visitor);
	}

    initBackToTop($('.back-to-top'));
});

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-4386938-1']);
_gaq.push(['_setDomainName', '.tuchong.com']);

_gaq.push(['_trackPageview']);

googleAnalytics();

window.BMap_loadScriptTime = (new Date).getTime();
</script>
<script type="text/javascript" src="https://api.map.baidu.com/getscript?v=2.0&ak=0nzi4aMlO81DBqYQUzY4QU35&services=&t=20150213143539"></script>

 <div style="width:100%; position:fixed; left:0; bottom:0;">
<%@ include file="footer.jsp" %>
</div>
<!--[if lt IE 9]>
<iframe class="bc-warn" src="browsercheck.html" frameborder="0"></iframe>
<div class="bc-screen-lock"></div>
<link href="http://static.tuchong.net/styles/ie-checker.css?1435126808.css" rel="stylesheet" />
<![endif]-->
<div class="back-to-top direction-caret big"></div>


</body> 
</html>
